/**
 * Created by wyy on 17-7-10.
 */

angular.module('tribalc').factory('Alert',['$rootScope', function ($rootScope) {
    function alertBox(text,sucfun) {
        if (arguments.length>1){
           $rootScope.succState=true;
        }else {
            $rootScope.succState=false;
        }
            show(text);
            $rootScope.sucfun=sucfun?sucfun:'';
    }
    function show(text) {
            $rootScope.alerttex = text;
            $rootScope.showAlert = true;
    }



    return {
        alertBox: alertBox
    };

}]);